#include "at91sam7s.h"
#include "board.h"

void boot(void)
{
    AT91PIO *pio = AT91PIO_ADDR;
    unsigned n, on;
    
    pio->output_disable = BOARD_OUTPUT_DISABLE;
    pio->output_enable = BOARD_OUTPUT_ENABLE;
    pio->pullup_disable = BOARD_PULLUP_DISABLE;
    pio->pullup_enable = BOARD_PULLUP_ENABLE;
    pio->select_a = BOARD_SELECT_A;
    pio->select_b = BOARD_SELECT_B;
    pio->pio_disable = BOARD_PIO_DISABLE;
    pio->pio_enable = BOARD_PIO_ENABLE;

    on = 0;
    n = 0;
	for(;;) {
        if(n++ < 1000000) continue;
        n = 0;
        if(on) {
            pio->data_set = PIN_LED_YELLOW;
            on = 0;
        } else {
            pio->data_clear = PIN_LED_YELLOW;
            on = 1;
        }
    }
}
